//
//  HomerListViewController.swift
//  SwitfTest
//
//  Created by runone02 on 2018/12/28.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

import UIKit

class HomerListViewController: BaseTableViewController,SecondVCDelegate{

    var titlesId:String!

    override func viewDidLoad() {
        super.viewDidLoad()
        print(titlesId)
        tableView.register(HomeListCell.self, forCellReuseIdentifier: "HomeCell")
        tableView.rowHeight = 200
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: - Table view data source

    override func numberOfSections(in tableView: UITableView) -> Int {

        return 1
    }

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
    }

    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier:  "HomeCell", for: indexPath) as! HomeListCell
            cell.sendValueBlock = {(index:Int,str:String)in
                print(index,str)
            }
 
        return cell
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        let tevc = testViewController()
        tevc.delegate = self
 
        self.navigationController?.pushViewController(tevc, animated: true)
    }
    
    
    /// 实现代理方法
    func changeColor(tempString: NSString) {
        print("代理返回 : " + (tempString as String))
    }
 
}
